[SUBROUTINE]
version = 1.14
icon = line-polar.png
name = _("Line Polar")
type = poly-line-polar
help = _("<b>Trace a line to a polar position</b>&#10;Relative with optional styled corner")
order = act h2 cs cr rev h1 a type l h3 ted te

[PARAM_ACT]
name = _("Active")
icon = enable.png
type = bool
value = 1

[PARAM_H1]
type = sub-header
name = _("Definition")

[PARAM_L]
name = _("Length")
header = h1
type = float
minimum_value = 0.0
icon = line-len.png
tool_tip = _("Length of line")
value = 2
metric_value = 50
not_allowed = 0

[PARAM_A]
name = _("Angle")
header = h1
type = float
icon = angle.png
digits = 2
tool_tip = _("Angle")
value = 60
suffix = &#176;

[PARAM_TYPE]
name = _("Angle option")
header = h1
type = combo
options = _("Absolute=2:Relative to previous line or chord=3:Relative to previous arc center=30")
icon = line-rel.png
tool_tip = _("Angle relative to previous line or absolute")
value = 2

[PARAM_H2]
name = _("Link")
type = sub-header
tool_tip = _("Link style with previous item")

[PARAM_CS]
name = _("Type")
header = h2
type = combo
options = _("None=0:Rounded=1:Beveled=2:Inverted Round=3")
icon = corner-style.png
tool_tip = _("Corner style to apply with previous item")
value = 0

[PARAM_CR]
name = _("Radius")
header = h2
type = float
minimum_value = 0.0
icon = corner-radius.png
tool_tip = _("Radius for rounded or distance from apex")
value = 0.3
metric_value = 6

[PARAM_REV]
name = _("Complement")
icon = complement.png
type = bool
header = h2
tool_tip = _("Reverse direction of tool path for rounded or inverted round")
value = 0

[PARAM_H3]
name = _("Milling")
type = sub-header
hidden = 1

[PARAM_TED]
name = _("Tool engagement")
type = combo-user
options = _("Global=0:Specific=1")
icon = tool-eng.png
links = te=1
value = 0
header = h3
tool_tip = _("Tool engagement for this segment")

[PARAM_TE]
name = _("Tool engagement")
type = int
value = 100
header = h3
maximum_value = 100
minimum_value = 0
hidden = 1
suffix = %


[CALL]
content =
	(begin #sub_name)
	(line to relative polar position author : Fernand Veilleux)
	
	o<#self_id_active> if [#param_act AND #<in_polyline>]
		o<select> CALL [31] [#param_ted] [#<poly_global_engagement>] [#param_te]
		o<poly_add_item> CALL [#param_type] [#param_l * COS[#param_a]] [#param_l * SIN[#param_a]] [1] [#param_cs] [#param_cr] [#param_rev] [#31]
		
	o<#self_id_active> endif
	(end #sub_name)
